package com.chenyongjing.design.pattern.adapter;

/**
 * 客户端类：想上网，插不上网线
 */
public class Computer {
    //我们的电脑需要连接上转接器才可以上网
    private void net(NetToUSB adapter){
        //上网的具体实现，找一个转接头
        adapter.handleRequest();

    }

    public static void main(String[] args){
        // 电脑，网线
        Computer computer  = new Computer();
        Adapter adapter = new Adapter();

        computer.net(adapter);

        // 电脑，适配器，网线
        Adaptee adaptee = new Adaptee();
        AdapterMore adapterMore = new AdapterMore(adaptee);

        computer.net(adapterMore);
    }
}
